{% extends "base.html" %}
{% load authorization_tags %}
{% block content %}
    {{ block.super }}
    <h3>Create New Questionnaire</h3>
    <form class="form-horizontal" method="post">{% csrf_token %}
        {% include "dojo/form_fields.html" with form=form %}
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">

                {% if survey %}
                    <input class="btn btn-primary" type="submit" label="create_questionnaire" name="create_questionnaire" value="Update Questionnaire"/>
                    <input class="btn btn-primary" type="submit" label="add_questions" name="add_questions"
                           value="Edit Questions"/>
                    {% if "dojo.delete_engagement_survey"|has_configuration_permission:request %}
                    <a class="btn btn-danger" href="{% url 'delete_questionnaire' survey.id %}">Delete Questionnaire</a>
                    {% endif %}
                {% else %}
                    <input class="btn btn-primary" type="submit" label="create_questionnaire" name="create_questionnaire" value="Create Questionnaire"/>
                    <input class="btn btn-primary" type="submit" label="add_questions" name="add_questions"
                           value="Create Questionnaire and Add Questions"/>
                {% endif %}
            </div>
        </div>
    </form>

{% endblock %}